

# 开始时间
beginTime=`date +%s`
DATE=`date '+%Y-%m-%d-%T'`
#需要编译的 targetName
TARGET_NAME="Hoolink"
#编译路径
BUILDPATH=~/Desktop/XCodeBuild/${DATE}
#archivePath
ARCHIVEPATH=${BUILDPATH}/${TARGET_NAME}.xcarchive
#输出的ipa目录
IPAPATH=${BUILDPATH}

echo "~~~~~~~~~~~~~~~~开始清理~~~~~~~~~~~~~~~~~~~"

# 清理 避免出现一些莫名的错误
xcodebuild clean -workspace ${TARGET_NAME}.xcworkspace \
-configuration \
${CONFIGURATION} -alltargets

echo "~~~~~~~~~~~~~~~~文件清理完毕 ~~~~~~~~~~~~~~~~~~~"


xcodebuild archive -workspace Hoolink.xcworkspace -scheme  Hoolink -configuration Test -archivePath ${ARCHIVEPATH}

xcodebuild -exportArchive -archivePath ${ARCHIVEPATH} -exportPath ${IPAPATH}/${TARGET_NAME} -exportFormat ipa -exportProvisioningProfile "iOS Team Provisioning Profile: com.gomemyc.mylc.ios.enterprise"

exit 1


